<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<style>
    .parent {
        width: 500px;
        height: 50px;
        background-color: green;
        border: 1px solid #E74D4D;
    }

    .child {
        width: 100%;
        height: 30px;
        background-color: pink;
    }
    .child2{
        margin: 20px;
    }
</style>
<div class="parent">
    <div class="child2">    <!-- 设置margin: 20px; -->
        <div class="child"></div>
    </div>
</div>
</body>
</html>
